import React, { Component } from 'react'

export default class Dialog extends Component {
    constructor (props) {
        super(props);
        this.state = {}
    }
    render() {
        return (
            <div className='dialog-box' style={{ display: this.props.visiable ? '' : 'none' }}>
                <div className='dialog'>
                    <h3 className='title'> {this.props.title}</h3>
                    <div className='context'> {this.props.children}</div>
                    <div className='footer'>
                        <button onClick={() => { this.props.confirm() }}>确定</button>
                        <button onClick={() => { this.props.cancel() }}>取消</button>
                    </div>
                </div>
            </div>
        )
    }
}


